/* eslint-disable */
import request from '@/utils/request'

// 买家管理首页
export function getListData(params) {
  return request({
    url: '/users/list',
    method: 'GET',
    params
  })
}

// 添加备注
export function setRemark(data) {
  return request({
    url: '/users/remark/' + data.userId,
    method: 'POST',
    data
  })
}

// 修改备注
export function modRemark(data) {
  return request({
    url: '/users/remark/' + data.remarkId,
    method: 'PUT',
    data
  })
}

// 买家导出
export function exportData() {
  return request({
    url: '/shop/mp/buyer/export',
    method: 'POST'
  })
}

// 买家详情
export function getDetailsData(params) {
  return request({
    url: '/users/' + params.id,
    method: 'get',
    params
  })
}

// 交易记录
export function getTraderecordsData(params) {
  return request({
    url: '/users/trade/records/' + params.id,
    method: 'get',
    params
  })
}

// 设为分销商角色
export function fxsset(data) {
  return request({
    url: '/users/sale/' + data.userId,
    method: 'POST',
    data
  })
}

// 取消分销商角色
export function setusers(data) {
  return request({
    url: '/users/user/' + data.userId,
    method: 'PUT',
    data
  })
}
// 分销商列表
export function resellerlist(params) {
  return request({
    url: '/reseller/list',
    method: 'get',
    params
  })
}

// 分销商管理--消费能力
export function resellerspendingPower(params) {
  return request({
    url: '/reseller/spendingPower/' + params.user_id,
    method: 'get',
    params
  })
}

// 分销商管理--佣金变动
export function resellerrewardChange(params) {
  return request({
    url: '/reseller/rewardChange/' + params.user_id,
    method: 'get',
    params
  })
}

// 分销商信息
export function resellerInfo(data) {
  return request({
    url: '/reseller/resellerInfo/' + data.user_id,
    method: 'get',
    data
  })
}
//等级列表
export function getGradeList(data) {
  return request({
    url: '/reseller/gradeList',
    method: 'get',
    data
  })
}
//新建等级
export function AddnewGradeList(data) {
  return request({
    url: '/reseller/gradeAdd',
    method: 'post',
    data
  })
}
// 删除等级
export function deleteGradeList(params) {
  return request({
    url: '/reseller/' + params.gradeId,
    method: 'delete',
    params
  })
}
//等级修改
export function xiugaidengji(params) {
  return request({
    url: '/reseller/' + params.gradeId,
    method: 'put',
    params
  })
}
// 分销商会员等级信息
export function dengjimessage(params) {
  return request({
    url: '/reseller/resellerGradeShow/' + params.userId,
    method: 'get',
    params
  })
}
// 设置分销商等级
export function setUserGradeLevel(data) {
  return request({
    url: `users/${data.userId}/update/grade`,
    method: 'PUT',
    data
  })
}
// 获取商家分销设置
export function getfenxiaoSet(data) {
  return request({
    url: '/sales/config',
    method: 'get',
    data
  })
}
// 设置分销
export function fenxiaoSet(data) {
  return request({
    url: '/sales/config',
    method: 'post',
    data
  })
}
// 获取自动降级设置
export function resellerdownGET(params) {
  return request({
    url: '/reseller/grade/down/config',
    method: 'GET',
    params
  })
}
// 获取自动降级设置
export function resellerdownPUT(data) {
  return request({
    url: '/reseller/grade/down/config',
    method: 'PUT',
    data
  })
}
// 获取自动升级设置
export function resellerupGET(params) {
  return request({
    url: '/reseller/grade/up/config',
    method: 'GET',
    params
  })
}
// 获取自动升级设置
export function resellerupPUT(data) {
  return request({
    url: '/reseller/grade/up/config',
    method: 'PUT',
    data
  })
}
//中奖纪录
export function getReward(params) {
  return request({
    url: `/users/${params.id}/award`,
    method: 'get',
    params
  })
}
//积分变动记录
export function integrationList(params) {
  return request({
    url: `/users/${params.id}/point`,
    method: 'get',
    params
  })
}
// 客户管理列表 -- 积分调整
export function setCustomPoint(data) {
  return request({
    url: `/users/${data.id}/point`,
    method: 'PUT',
    data
  })
}
